#ifndef CENTRAL_CACHE_H
#define CENTRAL_CACHE_H

#include "Common.h"

class CentralCache
{
public:
    int alloc(void *&start, void *&end, size_t size, size_t batchNum);
    void dealloc(void *&start, void *&end, size_t size);
    Span *getOneSpan(SpanList &spanList, size_t size);

    static CentralCache &getCentralCache()
    {
        return centralCache;
    }

private:
    CentralCache() {}
    CentralCache(CentralCache &) = delete;

    SpanList _freeList[NFREE_LIST];
    static CentralCache centralCache;
};

#endif